package com.novax.ex.activity.provider.api;

import com.novax.ex.activity.provider.api.model.AssetChangeRequest;
import com.novax.ex.activity.provider.api.model.UserAsset;
import com.novax.ex.activity.provider.common.ServerName;
import com.novax.ex.common.results.ReturnResult;
import org.springframework.cloud.openfeign.FeignClient;
import org.springframework.cloud.openfeign.SpringQueryMap;
import org.springframework.web.bind.annotation.GetMapping;
import org.springframework.web.bind.annotation.PostMapping;
import org.springframework.web.bind.annotation.RequestBody;
import org.springframework.web.bind.annotation.RequestParam;

/**
 * Description: 用户资产 下单 解冻等操作
 *
 * @author shaw
 * @date 12/1/22 17:09
 */
@FeignClient(url = "${remote.spot-service.endpoint}", name = "UserAssetApi", contextId = "UserAssetApi")
public interface UserAssetApi {

    /**
     * Description: 查询资产
     *
     * @param userId uid
     * @param currency 币种
     * @return com.novax.ex.common.results.ReturnResult<UserAsset>
     * @author shaw
     * @date 12/1/22 5:35 PM
     */
    @GetMapping(value = "/private/asset/spot")
    ReturnResult<UserAsset> findAsset(@RequestParam("userId") Long userId, @RequestParam("currency") String currency);

    /**
     * Description: 资产变动
     *
     * @param assetChangeRequest 资产变动信息
     * @return com.novax.ex.common.results.ReturnResult
     * @author shaw
     * @date 12/1/22 5:36 PM
     */
    @PostMapping(value = "/private/asset/spot")
    ReturnResult assetChange(@RequestBody AssetChangeRequest assetChangeRequest);

}
